home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************
- * TEXTRA-AREXX script -- Mike Haas, 1993, Public Domain *
- * *
- * For use with TEXTRA, the GUI-based Amiga Text Editor. *
- * *
- * If you enhance or write your own Textra scripts, please send *
- * to me... especially if you want them added to the package. *
- *******************************************************************/
-
- /*
- ** This script is handy for JForth programmers.
- ** It requires at least version 1.15, rexx level 10, of Textra.
- ** You can find out your full Textra version by entering into
- ** one of the ARexx requester strings:
- **
- ** @options results;textraversion;notify result
- **
- ** This script will mark all the functions defined in a
- ** standard Commodore-format autodoc.
- **
- ** This script also requires the bol.textra script, which comes
- ** with Textra, to be available (in rexx: or 'launch' current dir)
- **
- ** Especially useful when assigned to a Textra Function
- ** key or CTRL-key macro.
- **
- ** Mike Haas, Dec 15, 1993
- **
- ** Freely-distributable for non-commercial purposes.
- **
- */
-
- options results
-
- /*check Textra version, must be rexx level 7 at least for MARKSELECT */
- rex = 0; result = "NOTSUPPORTED"
- address 'TEXTRA' 'textraversion'
- parse var result maj min rex
- if (result == "NOTSUPPORTED") | (rex < 10) then do
- address 'TEXTRA' 'notify "This version of Textra cannot run this script."'
- exit
- end
-
- done = 0
- libfound = 0
-
- gotoxy 0 0
-
- find '"TABLE OF CONTENTS"'
-
- if result = "OK" then do
- markselect "TABLE OF CONTENTS"
- down 2;bol
- get cursor position;parse var result libnameStart starty
- find '/'
- if result = "OK" then do
- get select position;parse var result libnameEnd endy dummy dummy
- if starty = endy then do
- gotoxy libnameStart starty
- selectto libnameEnd starty
- get select text;parse var result dummy' 'theLibName
- libfound = 1
- end
- end
- else
- exit
- end
-
- if libfound = 0 then do
- notify "Name of library not found in Table of Contents."
- exit
- end
-
- do while (done == 0)
- checkcancel; if (result == CANCEL) then exit
- newpage = d2c(12)
- find '"'newpage'"'
- if result == "OK" then do
- get select position;parse var result dummy dummy npex npey
- gotoxy npex npey
- get cursor char;parse var result thechar
- do while (thechar = ' ') | (thechar = ' ') | (thechar = "-1")
- right 1
- if (rc ~= 0) then
- exit
- get cursor char;parse var result thechar
- end
- /*
- ** we may be at the beginning of the library name
- */
- get cursor position;parse var result foundStart fsy
- find '/'
- if result = "OK" then do
- get select position;parse var result foundEnd fey funcStart dummy
- if fsy = fey then do
- /*
- ** the / character is on the same line
- */
- gotoxy foundStart fsy
- selectto foundEnd fsy
- get select text;parse var result dummy' 'foundName
- if foundName = theLibName then do
- /*
- ** goto the function name
- */
- gotoxy funcStart fey
- /*
- ** locate the end of it
- */
- /*
- hopto next blank;if rc ~= 0 then exit
- */
- get cursor char;parse var result thechar
- do while ((thechar ~= ' ') & (thechar ~= ' ') & (thechar ~= '(') & (thechar ~= '-1'))
- right 1
- if (rc ~= 0) then
- exit
- get cursor char;parse var result thechar
- end
- get cursor position;parse var result endx dummy
- left 1
- do while (thechar ~= '/')
- left 1
- get cursor char;parse var result thechar
- end
- right 1
- /*
- ** and mark it
- */
- selectto endx fey
- get select text;parse var result dummy' 'funcName
- markselect funcName
- end
- end
- end
- end
- end
-